<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DescargarInscripcion PDF
 *
 * @author MFerreira
 * 
 * @export Modules
 */
class DescargarInscripcionPDF extends Module {

    public function index() {
        $this->assign("action", $this->route->action("GenerarPDF"));
        $this->display("index");
    }

    public function GenerarPDF() {
        if ($this->request->submitted()) {
            Loader::using("models::entities::InteresadoPk");
            Loader::using("models::entities::Identificacion");
            Loader::using("models::entities::PeriodoAcademico");

            $InteresadoPk = new InteresadoPk();
            $Identificacion = new Identificacion();
            $PeriodoAcademico = new PeriodoAcademico();

            $Identificacion->setNumeroDocumentoIdentidad($this->request->post("Identificacion"));
            $PeriodoAcademico->setAno(2011);
            $PeriodoAcademico->setPeriodo(1);

            $InteresadoPk->setIdentificacion($Identificacion);
            $InteresadoPk->setPeriodoAcedemico($PeriodoAcademico);
            
            $servicesURI = ModulesContext::instance()->getConfig()->acawebServicesURI;
            $this->assign("URL", $servicesURI . trim($this->model->interested->GenerarPDF($InteresadoPk), '" '));
            $this->display();
        } else {
            $this->index();
        }
    }

}

?>
